Ext.define('Era.view.MenuWindow',{
    extend: 'Ext.window.Window',
    alias: 'widget.menuwindow',
    layout: 'hbox',
    height: 350,
    width: 550,
    
    border: false,
    modal: false,
    resizable: false,
    closeAction: 'hide',
    title: 'Event Manager Menu',

    initComponent: function() {
        
        // create the menu buttons
        this.menuItems = Ext.create('Era.view.MenuItems');  
        
        // create the menu panel
        this.menuPanel = Ext.create('Era.view.MenuPanel');
        
        // add the 2 components to the menu
        this.items = [
            this.menuItems,
            this.menuPanel
        ]
        
        this.callParent(this);
    },
    
    // add a component inside the menu panel
    loadScreen: function(screen) {
        
        if (screen != 'undefined' && screen != null) {
            
            // remove & destroy all previous components inside the panel
            this.menuPanel.removeAll(true);
            
            // add new component inside the panel
            this.menuPanel.add(screen);
            
            this.screen = screen;
        }
    }
    
});